var searchBtn=document.querySelector('.sousuo button')
var inputEle=document.querySelector('.sousuo input')

searchBtn.onclick=()=>{
    axios.get('/user/search',{params:{searchkey:inputEle.value}}).then((res)=>{
        render(res.data.list)
        console.log(res.data);
    })
}

function render(data){
    var str=''
    str=data.map((item,index)=>{
        return  `<ul class="row">
        <li>${item.email}</li> 
        <li>${item.name}</li>
        <li>${item.phone}</li>
        <li>${item.ingroup}</li>
        <li>${item.isadmin?'是':'否'}</li>
        <li class="${item.status?'':'error'}">${item.status?'正常':'异常'}</li>
        <li>
            <span class="iconfont icon-bianji editicon" id="101"></span>
            <span class="iconfont icon-shanchu deleteicon" id="101"></span>
        </li>
    </ul>
        `
    }).join('')
    if( str == '' ){
        str = '<ul style="text-align:center;color:red">未查询到数据!</ul>'
    }
    document.querySelector('.table .table-body').innerHTML=str
}

axios.get('user/list',{params: { page:1,count:2}}).then((res)=>{
    render(res.data.list)
    console.log(res.data);
})

axios.post('/user/login',{phone:'12345123456',
pass:'1234'}).then((res)=>{
    console.log(res.data);
})